package com.example.homeworktagger.config;

import dev.langchain4j.model.chat.ChatLanguageModel;
import dev.langchain4j.model.openai.OpenAiChatModel;
import dev.langchain4j.model.dashscope.QwenChatModel;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AiModelConfig {

    @Value("${langchain4j.deepseek.api-key}")
    private String deepseekApiKey;

    @Value("${langchain4j.deepseek.model-name}")
    private String deepseekModelName;

    @Value("${langchain4j.deepseek.base-url}")
    private String deepseekBaseUrl;

    @Value("${langchain4j.dashscope.api-key}")
    private String dashscopeApiKey;

    @Value("${langchain4j.dashscope.model-name}")
    private String dashscopeModelName;

    @Bean
    public ChatLanguageModel deepseekModel() {
        return OpenAiChatModel.builder()
                .apiKey(deepseekApiKey)
                .modelName(deepseekModelName)
                .baseUrl(deepseekBaseUrl)
                .build();
    }

    @Bean
    public ChatLanguageModel qwenModel() {
        return QwenChatModel.builder()
                .apiKey(dashscopeApiKey)
                .modelName(dashscopeModelName)
                .build();
    }
} 